#include "IA.h"

#include "CreatureObject.h"

#include "IAStateExplore.h"
#include "IAStateBring.h"





/** @brief ~IA
  *
  * @todo: document this function
  */
IA::~IA()
{

}

/** @brief createStates
  *
  * @todo: document this function
  */
  /*
IAState* IA::createStates()
{
   // IAState* st = createState(STA_BRING);
    IAState* st = createState(STA_EXPLORE);




}*/
/** @brief createState
  *
  * @todo: document this function
  */

IAState* IA::createState(STATE _state)
{
    IAState* r=0;
    switch(_state)
    {
    case STA_PASSIVE:
        break;

    case STA_EXPLORE:
    OgreFramework::getSingletonPtr()->m_pLog->logMessage("Creating IA State Explore");
        r=new IAStateExplore();
        r->setParent(this);
       // r->setParentCreature(m_parent);
       // changeState(r);
        break;

    case STA_BRING:
        OgreFramework::getSingletonPtr()->m_pLog->logMessage("Creating IA State Bring");
        r=new IAStateBring();
        r->setParent(this);
     //   r->setParentCreature(m_parent);
     //   OgreFramework::getSingletonPtr()->m_pLog->logMessage("set IA State Bring Parent Creature");
     //   changeState(r);
        break;
    }

    return r;

}
/*

IAState* IA::getState(STATE _state)
{
    IAState* r=0;



    return r;

}*/


/** @brief getActiveState
  *
  * @todo: document this function
  */
IA::STATE IA::getActiveState()
{
    //TODO
return STA_PASSIVE;
}




void IA::enter()
{

}
void IA::exit()
{

}
void IA::update(double timeSinceLastFrame)
{

if (!m_ActiveStateStack.empty())
m_ActiveStateStack.back()->update(timeSinceLastFrame);


}


/** @brief IA
  *
  * @todo: document this function
  */
IA::IA(CreatureObject* _parent):
    m_parent(_parent)
{

}

